<script setup>
const props = defineProps({
  num: {
    type: Number,
    required: true,
    validator: value => {
      return value < 50
    }
  }
})
const emits = defineEmits(['sonSetNum'])
const btnClick = () => {
  console.log('获取的数据:', props.num)
  emits('sonSetNum', props.num + 5)
}
</script>

<template>
  <div class="son-page">
    son----{{ num }}

    <br />
    <button @click="btnClick">打印获取的数据</button>
  </div>
</template>

<style scoped>
.son-page {
  width: 300px;
  height: 300px;
  border: 5px solid red;
}
</style>
